using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace MyGlassEdit.次要 { public partial class 快速设置 : Form { public 快速设置(任务 form,string ss) { if (directPacking.Setting.language == 1) System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("sq"); InitializeComponent(); parent = form; s = ss; } 任务 parent; string s; private void 快速设置_Load(object sender, EventArgs e) { label1.Text = s + ":"; textBox1.Left = label1.Left + label1.Width; } private void c1Button2_Click(object sender, EventArgs e) { } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Enter && textBox1.Enabled)//监听回车事件 { button1.PerformClick(); } //继续原来base.ProcessCmdKey中的处理 return base.ProcessCmdKey(ref msg, keyData); } private void c1Button1_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Trim() == "") { this.Close(); } else { if (s == "单价" || s == "长磨1" || s == "长磨2" || s == "短磨1" || s == "短磨2") { double price; if (!double.TryParse(textBox1.Text.Trim(), out price)) { globel.ShowFromWarningMessage("请输入有效数据"); return; } } else if (s == "数量") { int count; if (!Int32.TryParse(textBox1.Text.Trim(), out count)) { globel.ShowFromWarningMessage("请输入有效数据"); return; } } parent.fastset(textBox1.Text.Trim(), s); this.Close(); } } private void button2_Click(object sender, EventArgs e) { this.Close(); } } }